GdkCursor *grab_cursor;
guint cursor_timeout_id;
guint cursor_image_index;
+ guint cursor_image_delay;
GdkDragContext *drop_context;
wd->cursor_timeout_id = 0;
}
wd->cursor_image_index = 0;
+ wd->cursor_image_delay = 0;
}
static gboolean
struct wl_buffer *buffer;
int x, y, w, h, scale;
guint next_image_index, next_image_delay;
+ gboolean retval = G_SOURCE_REMOVE;
if (wd->grab_cursor)
{
else
{
wd->cursor_timeout_id = 0;
- return TRUE;
+ return retval;
}
if (!wd->wl_pointer)
- return FALSE;
+ return retval;
wl_pointer_set_cursor (wd->wl_pointer,
wd->enter_serial,
{
/* We admit only static icons during drags so far */
gdk_wayland_device_stop_window_cursor_animation (wd);
- return TRUE;
+ return retval;
}
next_image_index =
if (next_image_index != wd->cursor_image_index)
{
- guint id;
+ if (next_image_delay != wd->cursor_image_delay)
+ {
+ guint id;
+
+ gdk_wayland_device_stop_window_cursor_animation (wd);
- /* Queue timeout for next frame */
- id = g_timeout_add (next_image_delay,
- (GSourceFunc)gdk_wayland_device_update_window_cursor,
- wd);
- g_source_set_name_by_id (id, "[gtk+] gdk_wayland_device_update_window_cursor");
+ /* Queue timeout for next frame */
+ id = g_timeout_add (next_image_delay,
+ (GSourceFunc)gdk_wayland_device_update_window_cursor,
+ wd);
+ g_source_set_name_by_id (id, "[gtk+] gdk_wayland_device_update_window_cursor");
+ wd->cursor_timeout_id = id;
+ }
+ else
+ retval = G_SOURCE_CONTINUE;
- wd->cursor_timeout_id = id;
wd->cursor_image_index = next_image_index;
+ wd->cursor_image_delay = next_image_delay;
}
else
- wd->cursor_timeout_id = 0;
+ gdk_wayland_device_stop_window_cursor_animation (wd);
- return FALSE;
+ return retval;
}
static void